package org.crawler.task;

import java.util.Queue;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


public abstract class AbstractTaskQueue {
	
	private Queue taskQueue;	


	public Queue getTaskQueue() {
		return taskQueue;
	}

	public void setTaskQueue(Queue taskQueue) {
		this.taskQueue = taskQueue;
	}

	public  void add(Object e){
		taskQueue.offer(e);
	};
	
	public  Object get(){
		return taskQueue.poll();
	};
	
	public int getTaskCount()
	{
		
		return taskQueue.size();
	}	
	

	

}
